/*--- stacks.h ---------------------------- Listing 2-6 ---------
 *  Header file for stack operations
 *-------------------------------------------------------------*/

#ifndef STACKS_H
#define STACKS_H

struct StkElement {
    int   line_no;
    char  opener;
};

struct stack_struct {
    struct StkElement *base;        /* point to base of stack */
    int                stack_size;  /* number of elements */
    int                min_stack;   /* bottom-most element */
    int                max_stack;   /* last possible element */
    int                top;         /* current top */
};

typedef struct stack_struct Stack;

void   ClearStack (Stack *);
Stack *CreateStack(int);
int    PopElement (Stack *, struct StkElement *);
int    PushElement(Stack *, struct StkElement *);
struct StkElement *ViewElement(Stack *, int);

#endif
